
// 创建一个SegmentView实例
var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var hashdata = mm("do_HashData");
var common = require("common");

var viewShower1 = ui("viewShower1");
var lableA = ui("lableA");//"fontColor":"FF7E00FF"
var lableAfoot = ui("lableAfoot");//"bgColor":"FF7E00FF"
var lableB = ui("lableB");//"fontColor":"949EAAFF"
var lableBfoot = ui("lableBfoot");//"bgColor":"00000000"
var lableC = ui("lableC");//"fontColor":"949EAAFF"
var lableCfoot = ui("lableCfoot");//"bgColor":"00000000"
var lableD = ui("lableD");//"fontColor":"949EAAFF"
var lableDfoot = ui("lableDfoot");//"bgColor":"00000000"

page.on("back", function() {
	app.closePage();
})

var addGuide = ui("$").add("guide", "source://view/circle/base/manage/guide.ui", 0, 0);

/****************处理页面-头部-begin*****************/
var headerAout = ui("headerAout");
var addheader = headerAout.add("header", "source://view/reuse/header.ui", 0, 0);
//左上角-返回
ui(addheader+".headerLeft").on("touch", function() {
    app.closePage()
});
//右上角添加+图标
var imgNext = ui(addheader+".imgNext");
imgNext.source="source://image/common/add1.png";
imgNext.visible = true;
//右上角-创建按钮
ui(addheader+".headerRight").on("touch", function() {
	common.open("source://view/circle/base/manage/circleAdd.ui");
});
//头部标题
var header = ui("header");
header.bindData(hashdata);
hashdata.addData({"labelTitle" : "我的圈子"});
header.refreshData();
/****************处理页面-头部-end*****************/

var circleTabs = 
	[
        {"id":"tab0","path":"source://view/circle/base/manage/myCreateCircle.ui"},
		{"id":"tab1","path":"source://view/circle/base/manage/myJoinCircle.ui"},
		{"id":"tab2","path":"source://view/circle/base/manage/myManageCircle.ui"},
		{"id":"tab3","path":"source://view/circle/base/manage/myUpgradeCircle.ui"}
	];
viewShower1.addViews(circleTabs);
viewShower1.showView("tab0");

ui("ALayoutA").on("touch", function(data, e) {
	lableA.fontColor = "FF7E00FF";
	lableAfoot.bgColor = "FF7E00FF";
	lableB.fontColor = "949EAAFF";
	lableBfoot.bgColor = "00000000";
	lableC.fontColor = "949EAAFF";
	lableCfoot.bgColor = "00000000";
	lableD.fontColor = "949EAAFF";
	lableDfoot.bgColor = "00000000";
	viewShower1.showView("tab0");
	page.fire("myCreateCircle_tab_touch");
})

ui("ALayoutB").on("touch", function(data, e) {
	lableB.fontColor = "FF7E00FF";
	lableBfoot.bgColor = "FF7E00FF";
	lableA.fontColor = "949EAAFF";
	lableAfoot.bgColor = "00000000";
	lableC.fontColor = "949EAAFF";
	lableCfoot.bgColor = "00000000";
	lableD.fontColor = "949EAAFF";
	lableDfoot.bgColor = "00000000";
	viewShower1.showView("tab1");
	page.fire("myJoinCircle_tab_touch");
})

ui("ALayoutC").on("touch", function(data, e) {
	lableC.fontColor = "FF7E00FF";
	lableCfoot.bgColor = "FF7E00FF";
	lableA.fontColor = "949EAAFF";
	lableAfoot.bgColor = "00000000";
	lableB.fontColor = "949EAAFF";
	lableBfoot.bgColor = "00000000";
	lableD.fontColor = "949EAAFF";
	lableDfoot.bgColor = "00000000";
	viewShower1.showView("tab2");
	page.fire("myManageCircle_tab_touch");
})

ui("ALayoutD").on("touch", function(data, e) {
	lableD.fontColor = "FF7E00FF";
	lableDfoot.bgColor = "FF7E00FF";
	lableA.fontColor = "949EAAFF";
	lableAfoot.bgColor = "00000000";
	lableB.fontColor = "949EAAFF";
	lableBfoot.bgColor = "00000000";
	lableC.fontColor = "949EAAFF";
	lableCfoot.bgColor = "00000000";
	viewShower1.showView("tab3");
	page.fire("myUpgradeCircle_tab_touch");
})